<%--
  Created by IntelliJ IDEA.
  User: LCJ
  Date: 2017/6/14
  Time: 19:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="adminHeader.jsp" %>
<div id="form">
    <table border="1" cellpadding="0" cellspacing="0"
           style="width: 900px;border: #0affe7;align-content: center;font-size: 16px;text-align: center">
        <tr style="height: 30px;background: #00CCFF;color: white">
            <td>编号</td>
            <td>学号</td>
            <td>姓名</td>
            <td>性别</td>
            <td>电话号码</td>
            <td>编辑</td>
            <td>删除</td>
        </tr>
        <c:forEach items="${student}" var="student">
            <tr>
                <td>${student.id}</td>
                <td>${student.no}</td>
                <td>${student.name}</td>
                <td>
                    <c:if test="${student.sex==0}">男</c:if>
                    <c:if test="${student.sex==1}">女</c:if>
                </td>
                <td>${student.tell}</td>
                <td>
                    <a href="/students/update?id=${student.id}">
                        <img style="width: 50px;height: 27px" src="<%=basePath%>resources/img/edit.png"></a>
                </td>
                <td>
                    <a href="/students/${student.id}/delete">
                        <img style="width: 50px;height: 27px" src="<%=basePath%>resources/img/student_delete.png">
                    </a>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="3"></td>
            <td><a href="/students?page=0">首页</a></td>
            <td>
                <c:if test="${page>=10}">
                    <a href="/students?page=${page-10}">上一页</a>
                </c:if>
                <c:if test="${page<10}">
                    <a href="/students?page=${page=0}">上一页</a>
                </c:if>
            </td>
            <td>
                <c:if test="${page<(count-10)}">
                    <a href="/students?page=${page+10}">下一页</a>
                </c:if>
                <c:if test="${page>(count-10)&&page<count}">
                    <a href="/students?page=${page=count-(count-page)}">尾页</a>
                </c:if>
            </td>
            <td>共${total}页</td>
        </tr>
    </table>
</div>
<%@include file="tear.jsp" %>
